package com.bosssoft.permission.centre.dao.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.bosssoft.permission.centre.entity.User;
import com.sd365.common.core.common.dao.CommonMapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

public interface UserMapper extends CommonMapper<User> {
    /**
     * 根据名字查询是否已有数据，目的为防止重复添加
     */
    User selectByCode(String code);

    User selectById(Long id);


    /**
     * 修改user，不修改中间表，也就是不修改角色
     *
     * @param user
     * @return
     */
    Integer update(@Param("user") User user);

    Integer updateStatus(@Param("user") User user);

    List<User> commonQuery(User user);

    List<User> commonByQueryRoleId(@Param("user") User user, @Param("roleId") Long roleId);

    User selectUserByCodeTenantid(@Param("code")String code,@Param("tenantId") Long tenantId);

    User selectNameByCodePassword(@Param("code")String code,@Param("password") String password);


}
